import React from 'react'
import { Form, Input, Select } from 'antd';
const {Option} = Select
export default function userForm(props) {
  return (
    <div>
        <Form
          layout='vertical'
        >
          <Form.Item
            name="username"
            label="用户名"
            rules={[{ required: true, message: '请输入用户名!' }]}
          >
            <Input />
          </Form.Item>
          <Form.Item
            name="password"
            label="密码"
            rules={[{ required: true, message: '请输入密码!' }]}
          >
            <Input />
          </Form.Item>
          <Form.Item
            name="region"
            label="区域"
            rules={[{ required: true, message: '请输入区域!' }]}
          >
             <Select>
              {
                props.regionList.map(item=>{
                  return <Option key={item.id} value={item.value}>{item.value}</Option>
                })
              }
            </Select>
          </Form.Item>
          <Form.Item
            name="role"
            label="角色"
            rules={[{ required: true, message: '请输入角色!' }]}
          >
             <Select >
              {
                props.roleList.map(item=>{
                  return <Option key={item.id} value={item.roleName}>{item.value}</Option>
                })
              }
            </Select>
          </Form.Item>
        </Form>
    </div>
  )
}
